package cn.pzx.devbase.vm

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import cn.pzx.base_module.base.BaseViewModel
import cn.pzx.base_module.data.ListProjectBean
import cn.pzx.base_module.http.BaseResult
import cn.pzx.base_module.http.RetrofitClient
import cn.pzx.base_module.http.catchException
import cn.pzx.base_module.http.next
import com.blankj.utilcode.util.LogUtils
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
 * @author pzx
 * @description:
 * @date :3/4/21 9:01 AM
 */

class MainVM : BaseViewModel() {


var bannerList=MutableLiveData<ListProjectBean>()
//    MutableLiveData<>传入的数据类型，要与Service中BaseResult<>保证一致
//    var bannerData = MutableLiveData<List<BannerBean>>()
//    var articlesData = MutableLiveData<ArticleListBean>()

    fun getBannerTest() {
      launch({RetrofitClient.getInstance().create().getListProject()}){


          bannerList.value=it


      }
    }






}



